@extends('Admin.layouts.common')

@section('content')
    <div class="container">

        <button class="btn btn-info searchBtn" onclick="$('.search_box').slideToggle();">搜索/筛选</button>
        <a href="/config/add"><button class="btn btn-info">添加</button></a>
        <div class="search_box">
            <form id="search_form" method="GET">
                <label>
                    ID：<br>
                        <input name="id" type="text" class="form-control search_form_control" value="{{ $_search['id'] }}">
                </label>
                <label>
                    配置名称：<br>
                        <input name="key" type="text" class="form-control search_form_control" value="{{ $_search['key'] }}">
                </label>
                <label>
                    添加时间：<br>
                        <input name="create_time" id="create_time" type="text" class="form-control search_form_control daterange_picker" value="{{urldecode($_search['create_time'])}}">
                </label><br>
                <button class="btn btn-primary" type="submit">&nbsp;&nbsp;确定&nbsp;&nbsp;</button>
            </form>
        </div>

        <div id="order_tag"></div>

        <div class="table-responsive">
            <table class="table">
                <caption>配置列表</caption>
                <thead>
                    <tr>
                        <th><a href="javascript:void(0);" data-order="id">id</a></th>
                        <th><a href="javascript:void(0);" data-order="id">配置参数</a></th>
                        <th>添加时间</th>
                        <th>修改时间</th>
                        <th>备注</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    @forelse($list->items() as $item)
                        <tr>
                            <td>{{ $item->id }}</td>
                            <td>{{ $item->key }}</td>
                            <td>{{ $item->create_time }}</td>
                            <td>{{ $item->edit_time }}</td>
                            <td>{{ $item->desc }}</td>
                            <td>
                                <a href="/config/index_subclass/{{ $item->id }}">配置参数</a>
                                <a href="/config/edit/{{ $item->id }}">编辑</a>
                                <!--<a href="/config/remove/{{ $item->id }}">删除</a>-->
                            </td>
                        </tr>
                    @empty
                        <tr><td class="text-center" colspan="5">没有数据</td></tr>
                    @endforelse
                </tbody>
            </table>
            <div class="text-center">
                {{ $list->links() }}
            </div>
        </div>

    </div>
@endsection

@section('foot')
<script type="text/javascript">
$(document).ready(function(){
@if(!$_search['create_time'])
    $('#create_time').val('');
@endif
});
</script>
@endsection